package com.woniu.mapper;

import com.woniu.entity.Warehouse;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 黄展旺njn
* @description 针对表【warehouse(仓库表)】的数据库操作Mapper
* @createDate 2025-09-08 19:18:07
* @Entity com.woniu.entity.Warehouse
*/
public interface WarehouseMapper {
    // 新增仓库
    int add(Warehouse warehouse);

    // 根据ID删除仓库(逻辑删除)
    int delete(Integer warehouseId);

    // 更新仓库信息
    int update(Warehouse warehouse);

    // 根据ID查询仓库
    Warehouse findById(Integer warehouseId);

    // 查询所有仓库
    List<Warehouse> findAll();

    // 模糊查询
    List<Warehouse> findByCondition(@Param("name") String name, @Param("address") String address);

    // 检查仓库是否被引用
    int checkReference(Integer warehouseId);

    // 停用仓库
    int disableWarehouse(Warehouse warehouse);

}
